Correction apparatus and method for angle sensor, and angle sensor

ABSTRACT

A correction apparatus for an angle sensor includes a correction information generator for generating correction information, and a correction processing unit for performing correction processing in the course of generation of a detected angle value by an angle detector. Details of the correction processing are determined on the basis of the correction information. The correction information generator includes an error estimate generation unit and a correction information determination unit. The error estimate generation unit generates, on the basis of a first signal and a second signal, an error estimate containing a variable component that varies depending on an ideal angle estimate. The correction information determination unit determines the correction information on the basis of the error estimate.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a correction apparatus and a correctionmethod for correcting an error of an angle sensor that generates adetected angle value having a correspondence with an angle to bedetected, and to an angle sensor including the correction apparatus.

2. Description of the Related Art

In recent years, angle sensors have been widely used to generate adetected angle value having a correspondence with an angle to bedetected in various applications, such as detection of the rotationalposition of a steering wheel or a power steering motor in an automobile.Examples of the angle sensors include a magnetic angle sensor. A systemusing the magnetic angle sensor is typically provided with a magneticfield generator for generating a rotating magnetic field whose directionrotates in response to the rotation or linear movement of an object. Themagnetic field generator is a magnet, for example. The angle to bedetected by the magnetic angle sensor is, for example, the angle thatthe direction of the rotating magnetic field in a reference positionforms with respect to a reference direction.

U.S. Patent Application Publication No. 2012/0095712 A1 describes arotating field sensor, which is a magnetic angle sensor. The rotatingfield sensor includes a signal generator for generating first and secondsignals associated with the intensities of components of a rotatingmagnetic field in mutually different directions, and an angle detectorfor calculating a detected angle value based on the first and secondsignals. The signal generator includes a first detection circuit foroutputting the first signal, and a second detection circuit foroutputting the second signal. Each of the first and second detectioncircuits includes at least one magnetic detection element. The magneticdetection element is, for example, a spin-valve magnetoresistance (MR)element including a magnetization pinned layer whose magnetizationdirection is pinned, a free layer whose magnetization direction variesdepending on the direction of the rotating magnetic field, and anonmagnetic layer located between the magnetization pinned layer and thefree layer.

Ideally, when the direction of the rotating magnetic field changes witha constant angular velocity, the first signal and the second signal inthe rotating field sensor should have sinusoidal waveforms (includingsine waveforms and cosine waveforms) that are different in phase fromeach other by 90°. However, as described in U.S. Patent ApplicationPublication No. 2012/0095712 A1, the first and second signals may havewaveforms distorted from a sinusoidal curve. When the first and secondsignals have distorted waveforms, the first signal contains a firstideal component which varies in such a manner as to trace an idealsinusoidal curve, and a first error component other than the first idealcomponent, and the second signal contains a second ideal component whichvaries in such a manner as to trace an ideal sinusoidal curve, and asecond error component other than the second ideal component.

One of the causes of the distortion of the waveforms of the first andsecond signals is a variation of the magnetization direction of themagnetization pinned layer of the MR element due to the influence of therotating magnetic field or the like. The distortion of the waveforms ofthe first and second signals may result in some error in the detectedangle value.

U.S. Patent Application Publication No. 2012/0095712 A1 discloses atechnique for reducing an error that occurs in the detected angle value.In the technique, a square-sum signal made up of the sum of the squareof the first signal and the square of the second signal is generated,and the first and second signals are corrected on the basis of thegenerated square-sum signal.

U.S. Patent Application Publication No. 2006/0076480 A1 discloses atechnique for correcting two-phase sinusoidal signals. When two-phasesinusoidal signals out of phase with each other are output from anencoder, they may form a Lissajous waveform containing an errordeviating from an ideal Lissajous waveform. In this technique, such anerror is detected and the two-phase sinusoidal signals are corrected onthe basis of the detected error. The two-phase sinusoidal signals inU.S. Patent Application Publication No. 2006/0076480 A1 are equivalentto the first and second signals in U.S. Patent Application PublicationNo, 2012/0095712 A1. A radius of the Lissajous waveform in U.S. PatentApplication Publication No. 2006/0076480 A1 is equivalent to a squareroot of the square-sum signal in U.S. Patent Application Publication No.2012/0095712 A1. In the following description, the two-phase sinusoidalsignals in U.S. Patent Application Publication No. 2006/0076480 A1 willalso be referred to as the first and second signals.

Both of the techniques disclosed in U.S. Patent Application PublicationNos. 2012/0095712 A1 and 2006/0076480 A1 relate to correction performedto reduce fluctuation in the magnitude of the square-sum signal. Thesetechniques can thus reduce an error that causes fluctuation in thesquare-sum signal.

While errors occurring in a detected angle value from an angle sensorvary depending on the angle to be detected, some of the errors do notcause fluctuation in the magnitude of the square-sum signal. Such anerror will hereinafter be referred to as angle-dependent error. Theangle-dependent error results from errors occurring in the same phase inthe first signal and the second signal. More specifically, theangle-dependent error occurs, depending on the angle to be detected,when the first signal and the second signal deviate from the first idealcomponent and the second ideal component, respectively, by the magnitudecorresponding to the angle-dependent error. For example, theangle-dependent error occurs when the free layer of the MR element inthe first detection circuit and the free layer of the MR element in thesecond detection circuit have magnetic anisotropies in the samedirection, or when there is a misalignment of relative positions of themagnetic field generator and the signal generator with respect to eachother. Neither of the techniques disclosed in U.S. Patent ApplicationPublication Nos. 2012/0095712 A1 and 2006/0076480 A1 can reduce theangle-dependent error.

OBJECT AND SUMMARY OF THE INVENTION

It is an object of the present invention to provide a correctionapparatus and a correction method for an angle sensor, and the anglesensor that make it possible to reduce an error in a detected anglevalue generated on the basis of first and second signals, the errorresulting from errors that occur in the same phase in the first andsecond signals.

A correction apparatus of the present invention is for use in an anglesensor that includes: a signal generator for generating a first signaland a second signal each having a correspondence with an angle to bedetected; and an angle detector for generating a detected angle value byperforming computations using the first signal and the second signal,the detected angle value having a correspondence with the angle to bedetected. An angle sensor of the present invention includes the signalgenerator, the angle detector, and the correction apparatus of thepresent invention.

When the angle to be detected varies with a predetermined period, thefirst signal contains a first ideal component and a first errorcomponent, and the second signal contains a second ideal component and asecond error component. The first ideal component and the second idealcomponent are different in phase from each other and vary periodicallyin such a manner as to trace an ideal sinusoidal curve.

The correction apparatus of the present invention includes: a correctioninformation generator for generating correction information; and acorrection processing unit for performing correction processing in thecourse of generation of the detected angle value by the angle detector,details of the correction processing being determined on the basis ofthe correction information. The correction processing is processing forbringing the detected angle value closer to an ideal angle estimate ascompared with an uncorrected detected angle value. The ideal angleestimate corresponds to a detected angle value obtained when the firstsignal does not contain the first error component, the second signaldoes not contain the second error component, and the correctionprocessing is not performed. The uncorrected detected angle valuecorresponds to a detected angle value obtained when the correctionprocessing is not performed.

The correction information generator includes an error estimategeneration unit and a correction information determination unit. Theerror estimate generation unit generates an error estimate on the basisof the first signal and the second signal under the condition that thefirst signal varies over time to contain the first ideal component andthe first error component and the second signal varies over time tocontain the second ideal component and the second error component, theerror estimate having a correspondence with a difference between theuncorrected detected angle value and the ideal angle estimate andcontaining a variable component that varies depending on the ideal angleestimate. The correction information determination unit determines thecorrection information on the basis of the error estimate.

In the correction apparatus and the angle sensor of the presentinvention, the angle to be detected may be an angle that the directionof a rotating magnetic field in a reference position forms with respectto a reference direction. In this case, the signal generator of theangle sensor of the present invention may include a first detectioncircuit for generating the first signal and a second detection circuitfor generating the second signal. Each of the first and second detectioncircuits may include at least one magnetic detection element fordetecting the rotating magnetic field. The at least one magneticdetection element may be at least one magnetoresistance elementincluding a magnetization pinned layer whose magnetization direction ispinned, a free layer whose magnetization direction varies depending onthe direction of the rotating magnetic field, and a nonmagnetic layerlocated between the magnetization pinned layer and the free layer.

In the correction apparatus and the angle sensor of the presentinvention, the first ideal component and the second ideal component maybe different in phase from each other by 90°.

In the correction apparatus and the angle sensor of the presentinvention, the error estimate generation unit may calculate the idealangle estimate and the uncorrected detected angle value at specifiedtime intervals on the assumption that the angular velocity of change inthe angle to be detected has a constant value, the uncorrected detectedangle value being calculated on the basis of the first and secondsignals, and may use the difference between the uncorrected detectedangle value and the ideal angle estimate as the error estimate.

In the correction apparatus and the angle sensor of the presentinvention, the correction processing may be processing for correctingthe first and second signals. In this case, the correction informationmay include first correction information and second correctioninformation. The first correction information contains one or morecoefficients among a plurality of coefficients provided to express thefirst error component as a Fourier series. The second correctioninformation contains one or more coefficients among a plurality ofcoefficients provided to express the second error component as a Fourierseries. The correction information determination unit may apply aFourier transform to a waveform representing change in the errorestimate with respect to change in the ideal angle estimate and maydetermine the first and second correction information on the basis ofthe result thereof. In the correction processing, an estimate of thefirst error component and an estimate of the second error component maybe obtained using the first and second signals before the correctionprocessing and the first and second correction information, the estimateof the first error component may be subtracted from the first signalbefore the correction processing to thereby generate a corrected firstsignal, and the estimate of the second error component may be subtractedfrom the second signal before the correction processing to therebygenerate a corrected second signal.

In the correction apparatus and the angle sensor of the presentinvention, the correction processing may be processing for generatingthe detected angle value by calculating the uncorrected detected anglevalue on the basis of the first and second signals and then correctingthe uncorrected detected angle value. In this case, the correctioninformation may be information that defines a waveform representingchange in the variable component of the error estimate with respect tochange in the ideal angle estimate. The correction informationdetermination unit may apply a Fourier transform to a waveformrepresenting change in the error estimate with respect to change in theideal angle estimate and may determine the correction information on thebasis of the result thereof.

A correction method for an angle sensor of the present invention is foruse for an angle sensor including: a signal generator for generating afirst signal and a second signal each having a correspondence with anangle to be detected; and an angle detector for generating a detectedangle value by performing computations using the first signal and thesecond signal, the detected angle value having a correspondence with theangle to be detected. When the angle to be detected varies with apredetermined period, the first signal contains a first ideal componentand a first error component, and the second signal contains a secondideal component and a second error component. The first ideal componentand the second ideal component are different in phase from each otherand vary periodically in such a manner as to trace an ideal sinusoidalcurve.

The correction method of the present invention includes: a step ofgenerating correction information; and a step of performing correctionprocessing in the course of generation of the detected angle value bythe angle detector, details of the correction processing beingdetermined on the basis of the correction information. The correctionprocessing is processing for bringing the detected angle value closer toan ideal angle estimate as compared with an uncorrected detected anglevalue. The ideal angle estimate corresponds to a detected angle valueobtained when the first signal does not contain the first errorcomponent, the second signal does not contain the second errorcomponent, and the correction processing is not performed. Theuncorrected detected angle value corresponds to a detected angle valueobtained when the correction processing is not performed.

The step of generating the correction information includes: a first stepof generating an error estimate on the basis of the first signal and thesecond signal under the condition that the first signal varies over timeto contain the first ideal component and the first error component andthe second signal varies over time to contain the second ideal componentand the second error component, the error estimate having acorrespondence with a difference between the uncorrected detected anglevalue and the ideal angle estimate and containing a variable componentthat varies depending on the ideal angle estimate; and a second step ofdetermining the correction information on the basis of the errorestimate.

In the correction method of the present invention, the angle to bedetected may be an angle that the direction of a rotating magnetic fieldin a reference position forms with respect to a reference direction.

In the correction method of the present invention, the first idealcomponent and the second ideal component may be different in phase fromeach other by 90°.

In the correction method of the present invention, in the first step theideal angle estimate and the uncorrected detected angle value may becalculated at specified time intervals on the assumption that theangular velocity of change in the angle to be detected has a constantvalue, the uncorrected detected angle value being calculated on thebasis of the first and second signals, and the difference between theuncorrected detected angle value and the ideal angle estimate may beused as the error estimate.

In the correction method of the present invention, the correctionprocessing may be processing for correcting the first and secondsignals. In this case, the correction information may include firstcorrection information and second correction information. The firstcorrection information contains one or more coefficients among aplurality of coefficients provided to express the first error componentas a Fourier series. The second correction information contains one ormore coefficients among a plurality of coefficients provided to expressthe second error component as a Fourier series. In the second step, aFourier transform may be applied to a waveform representing change inthe error estimate with respect to change in the ideal angle estimate,and the first and second correction information may be determined on thebasis of the result thereof. In the correction processing, an estimateof the first error component and an estimate of the second errorcomponent may be obtained using the first and second signals before thecorrection processing and the first and second correction information,the estimate of the first error component may be subtracted from thefirst signal before the correction processing to thereby generate acorrected first signal, and the estimate of the second error componentmay be subtracted from the second signal before the correctionprocessing to thereby generate a corrected second signal.

In the correction method of the present invention, the correctionprocessing may be processing for generating the detected angle value bycalculating the uncorrected detected angle value on the basis of thefirst and second signals and then correcting the uncorrected detectedangle value. In this case, the correction information may be informationthat defines a waveform representing change in the variable component ofthe error estimate with respect to change in the ideal angle estimate.In the second step, a Fourier transform may be applied to a waveformrepresenting change in the error estimate with respect to change in theideal angle estimate, and the correction information may be determinedon the basis of the result thereof.

According to the present invention, the error estimate having acorrespondence with the difference between the uncorrected detectedangle value and the ideal angle estimate is generated on the basis ofthe first and second signals, and the correction information isdetermined on the basis of the error estimate to perform the correctionprocessing the details of which are determined on the basis of thecorrection information. The present invention thus makes it possible toreduce an error in the detected angle value generated on the basis ofthe first and second signals, the error resulting from errors that occurin the same phase in the first and second signals.

Other and further objects, features and advantages of the presentinvention will appear more fully from the following description.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a perspective view illustrating the general configuration ofan angle sensor system including an angle sensor according to a firstembodiment of the invention.

FIG. 2 is an explanatory diagram illustrating the definitions ofdirections and angles used in the first embodiment of the invention.

FIG. 3 is a circuit diagram illustrating the configuration of a signalgenerator of the angle sensor according to the first embodiment of theinvention.

FIG. 4 is a functional block diagram illustrating the configuration ofan angle detector and a correction apparatus of the angle sensoraccording to the first embodiment of the invention.

FIG. 5 is a perspective view of a portion of a magnetic detectionelement shown in FIG. 3.

FIG. 6 is a flowchart of the step of generating correction informationin a correction method for the angle sensor according to the firstembodiment of the invention.

FIG. 7 is a flowchart of the operation of the angle detector of theangle sensor according to the first embodiment of the invention.

FIG. 8 is a waveform diagram illustrating an example of waveform of anangle-dependent error.

FIG. 9 is a waveform diagram illustrating the waveform of a square-sumsignal when the angle-dependent error is the only error occurring in thedetected angle value.

FIG. 10 is a waveform diagram illustrating the effect of the firstembodiment of the invention.

FIG. 11 is a functional block diagram illustrating the configuration ofan angle detector and a correction apparatus of an angle sensoraccording to a second embodiment of the invention.

FIG. 12 is a flowchart of the step of performing correction processingin a correction method for the angle sensor according to the secondembodiment of the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS First Embodiment

Preferred embodiments of the present invention will now be described indetail with reference to the drawings. First, reference is made to FIG.1 to describe the general configuration of an angle sensor systemincluding an angle sensor according to a first embodiment of theinvention.

The angle sensor 1 according to the present embodiment is configured togenerate a detected angle value θs having a correspondence with an angleθ to be detected. The angle sensor 1 according to the present embodimentis a magnetic angle sensor, in particular. As shown in FIG. 1, the anglesensor 1 according to the present embodiment detects a rotating magneticfield MF whose direction rotates. In this case, the angle θ to bedetected is the angle that the direction of the rotating magnetic fieldMF in a reference position forms with respect to a reference direction.The angle sensor system shown in FIG. 1 includes the angle sensor 1, anda magnet 5 having a cylindrical shape, which is an example of means forgenerating the rotating magnetic field MF. The magnet 5 has an N poleand an S pole that are arranged symmetrically with respect to a virtualplane including the central axis of the cylindrical shape. The magnet 5rotates about the central axis of the cylindrical shape. Consequently,the direction of the rotating magnetic field MF generated by the magnet5 rotates about a center of rotation C including the central axis of thecylindrical shape.

The reference position is located within a virtual plane parallel to anend face of the magnet 5. This virtual plane will hereinafter bereferred to as the reference plane. In the reference plane, thedirection of the rotating magnetic field MF generated by the magnet 5rotates about the reference position. The reference direction is locatedwithin the reference plane and intersects the reference position. In thefollowing description, the direction of the rotating magnetic field MFin the reference position refers to a direction located within thereference plane. The angle sensor 1 is placed to face the aforementionedend face of the magnet 5.

The angle sensor system of the present embodiment may be configured inother ways than illustrated in FIG. 1. The angle sensor system of thepresent embodiment need only be configured to vary the relativepositional relationship between the angle sensor 1 and the means forgenerating the rotating magnetic field MF so that the direction of therotating magnetic field MF in the reference position rotates when viewedfrom the angle sensor 1. For example, the magnet 5 and the angle sensor1 arranged as shown in FIG. 1 may be configured so that: the anglesensor 1 rotates while the magnet 5 is fixed; the magnet 5 and the anglesensor 1 rotate in opposite directions; or the magnet 5 and the anglesensor 1 rotate in the same direction with mutually different angularvelocities.

Alternatively, a magnet that includes one or more pairs of N and S polesarranged alternately in an annular shape may be employed in place of themagnet 5, and the angle sensor 1 may be placed in the vicinity of theouter circumference of the magnet. In this case, at least one of themagnet and the angle sensor 1 rotates.

Alternatively, a magnetic scale that includes a plurality of pairs of Nand S poles arranged alternately in a liner configuration may beemployed in place of the magnet 5, and the angle sensor 1 may be placedin the vicinity of the periphery of the magnetic scale. In this case, atleast one of the magnetic scale and the angle sensor 1 moves linearly inthe direction in which the N and S poles of the magnetic scale arealigned.

In the above-described various configurations of the angle sensorsystem, there also exists the reference plane having a predeterminedpositional relationship with the angle sensor 1, and in the referenceplane, the direction of the rotating magnetic field MF rotates about thereference position when viewed from the angle sensor 1.

The angle sensor 1 includes a signal generator 2 for generating a firstsignal and a second signal each having a correspondence with the angle θto be detected. The signal generator 2 includes a first detectioncircuit 10 for generating the first signal and a second detectioncircuit 20 for generating the second signal. For ease of understanding,FIG. 1 illustrates the first and second detection circuits 10 and 20 asseparate components. However, the first and second detection circuits 10and 20 may be integrated into a single component. Further, while in FIG.1 the first and second detection circuits 10 and 20 are stacked in adirection parallel to the center of rotation C, the order of stackingmay be inversed from that shown in FIG. 1. Each of the first and seconddetection circuits 10 and 20 includes at least one magnetic detectionelement for detecting the rotating magnetic field MF.

Definitions of directions and angles used in the present embodiment willnow be described with reference to FIG. 1 and FIG. 2. First, Z directionis the direction parallel to the center of rotation C shown in FIG. 1and from bottom to top in FIG. 1. FIG. 2 illustrates the Z direction asthe direction out of the plane of FIG. 2. Next, X and Y directions aretwo directions that are perpendicular to the Z direction and orthogonalto each other. FIG. 2 illustrates the X direction as the rightwarddirection, and the Y direction as the upward direction. Further, −Xdirection is the direction opposite to the X direction, and −Y directionis the direction opposite to the Y direction.

The reference position PR is the position where the angle sensor 1detects the rotating magnetic field MF. The reference direction DR shallbe the X direction. As mentioned above, the angle θ to be detected isthe angle that the direction DM of the rotating magnetic field MF in thereference position PR forms with respect to the reference direction DR.The direction DM of the rotating magnetic field MF shall rotatecounterclockwise in FIG. 2. The angle θ will be expressed in positivevalues when seen counterclockwise from the reference direction DR, andin negative values when seen clockwise from the reference direction DR.

The configuration of the signal generator 2 will now be described indetail with reference to FIG. 3. FIG. 3 is a circuit diagramillustrating the configuration of the signal generator 2. As mentionedabove, the signal generator 2 includes the first detection circuit 10for generating the first signal S1 and the second detection circuit 20for generating the second signal S2.

As the direction DM of the rotating magnetic field MF rotates with apredetermined period, the angle θ to be detected varies with thepredetermined period. In this case, both of the first and second signalsS1 and S2 vary periodically with a signal period equal to theaforementioned predetermined period. The second signal S2 differs fromthe first signal S1 in phase. In the present embodiment, that phase ofthe second signal S2 preferably differs from the phase of the firstsignal S1 by an odd number of times ¼ the signal period. However, inconsideration of the production accuracy of the magnetic detectionelements and other factors, the difference in phase between the firstsignal S1 and the second signal S2 can be slightly different from an oddnumber of times ¼ the signal period. The following description assumesthat the phases of the first signal S1 and the second signal S2 satisfythe aforementioned preferred relationship.

The first detection circuit 10 includes a Wheatstone bridge circuit 14and a difference detector 15. The Wheatstone bridge circuit 14 includesa power supply port V1, a ground port G1, two output ports E11 and E12,a first pair of serially connected magnetic detection elements R11 andR12, and a second pair of serially connected magnetic detection elementsR13 and R14. One end of each of the magnetic detection elements R11 andR13 is connected to the power supply port V1. The other end of themagnetic detection element R11 is connected to one end of the magneticdetection element R12 and the output port E11. The other end of themagnetic detection element R13 is connected to one end of the magneticdetection element R14 and the output port E12. The other end of each ofthe magnetic detection elements R12 and R14 is connected to the groundport G1. A power supply voltage of predetermined magnitude is applied tothe power supply port V1. The ground port G1 is grounded. The differencedetector 15 generates a signal corresponding to a potential differencebetween the output ports E11 and E12 and normalized to have an amplitudeof 1, and outputs the generated signal as the first signal S1.

The second detection circuit 20 has a circuit configuration similar tothat of the first detection circuit 10. More specifically, the seconddetection circuit 20 includes a Wheatstone bridge circuit 24 and adifference detector 25. The Wheatstone bridge circuit 24 includes apower supply port V2, a ground port G2, two output ports E21 and E22, afirst pair of serially connected magnetic detection elements R21 andR22, and a second pair of serially connected magnetic detection elementsR23 and R24. One end of each of the magnetic detection elements R21 andR23 is connected to the power supply port V2. The other end of themagnetic detection element R21 is connected to one end of the magneticdetection element R22 and the output port E21. The other end of themagnetic detection element R23 is connected to one end of the magneticdetection element R24 and the output port E22. The other end of each ofthe magnetic detection elements R22 and R24 is connected to the groundport G2. A power supply voltage of predetermined magnitude is applied tothe power supply port V2. The ground port G2 is grounded. The differencedetector 25 generates a signal corresponding to a potential differencebetween the output ports E21 and E22 and normalized to have an amplitudeof 1, and outputs the generated signal as the second signal S2.

In the present embodiment, all the magnetic detection elements includedin the Wheatstone bridge circuits (hereinafter referred to as bridgecircuits) 14 and 24 are magnetoresistance (MR) elements, and morespecifically, spin-valve MR elements. The spin-valve MR element includesa magnetization pinned layer whose magnetization direction is pinned, afree layer which is a magnetic layer whose magnetization directionvaries depending on the direction DM of the rotating magnetic field MF,and a nonmagnetic layer located between the magnetization pinned layerand the free layer. The spin-valve MR element may be a TMR element or aGMR element. In the TMR element, the nonmagnetic layer is a tunnelbarrier layer. In the GMR element, the nonmagnetic layer is anonmagnetic conductive layer. The spin-valve MR element varies inresistance depending on the angle that the magnetization direction ofthe free layer forms with respect to the magnetization direction of themagnetization pinned layer, and has a minimum resistance when theforegoing angle is 0° and a maximum resistance when the foregoing angleis 180°. In the following description, the magnetic detection elementsincluded in the bridge circuits 14 and 24 will be referred to as MRelements. In FIG. 3, the filled arrows indicate the magnetizationdirections of the magnetization pinned layers of the MR elements, andthe hollow arrows indicate the magnetization directions of the freelayers of the MR elements.

In the first detection circuit 10, the magnetization pinned layers ofthe MR elements R11 and R14 are magnetized in the X direction, and themagnetization pinned layers of the MR elements R12 and R13 aremagnetized in the X direction. In such a case, the potential differencebetween the output ports E11 and E12 varies according to the strength ofa component in the X direction (hereinafter, “X-directional component”)of the rotating magnetic field MF. Thus, the first detection circuit 10detects the strength of the X-directional component of the rotatingmagnetic field MF and generates a signal that indicates the strength asthe first signal S1. The strength of the X-directional component of therotating magnetic field MF has a correspondence with the angle θ to bedetected.

In the second detection circuit 20, the magnetization pinned layers ofthe MR elements R21 and R24 are magnetized in the Y direction, and themagnetization pinned layers of the MR elements R22 and R23 aremagnetized in the Y direction. In such a case, the potential differencebetween the output ports E21 and E22 varies according to the strength ofa component in the Y direction (hereinafter, “Y-directional component”)of the rotating magnetic field MF. Thus, the second detection circuit 20detects the strength of the Y-directional component of the rotatingmagnetic field MF and generates a signal that indicates the strength asthe second signal S2. The strength of the Y-directional component of therotating magnetic field MF has a correspondence with the angle θ to bedetected.

In consideration of the production accuracy of the MR elements and otherfactors, the magnetization directions of the magnetization pinned layersof the plurality of MR elements in the detection circuits 10 and 20 maybe slightly different from those described above.

An example of the configuration of the MR elements will now be describedwith reference to FIG. 5. FIG. 5 is a perspective view illustrating aportion of an MR element in the signal generator 2 shown in FIG. 3. Inthis example, the MR element includes a plurality of lower electrodes142, a plurality of MR films 150 and a plurality of upper electrodes143. The plurality of lower electrodes 142 are arranged on a substrate(not illustrated). Each of the lower electrodes 142 has a long slendershape. Every two lower electrodes 142 that are adjacent to each other inthe longitudinal direction of the lower electrodes 142 have a gaptherebetween. As shown in FIG. 5, MR films 150 are provided on the topsurfaces of the lower electrodes 142, near opposite ends in thelongitudinal direction. Each of the MR films 150 includes a free layer151, a nonmagnetic layer 152, a magnetization pinned layer 153, and anantiferromagnetic layer 154 which are stacked in this order, the freelayer 151 being closest to the lower electrode 142. The free layer 151is electrically connected to the lower electrode 142. Theantiferromagnetic layer 154 is formed of an antiferromagnetic material.The antiferromagnetic layer 154 is in exchange coupling with themagnetization pinned layer 153 so as to pin the magnetization directionof the magnetization pinned layer 153. The plurality of upper electrodes143 are arranged over the plurality of MR films 150. Each of the upperelectrodes 143 has a long slender shape, and establishes electricalconnection between the respective antiferromagnetic layers 154 of twoadjacent MR films 150 that are arranged on two lower electrodes 142adjacent in the longitudinal direction of the lower electrodes 142. Withsuch a configuration, the plurality of MR films 150 in the MR elementshown in FIG. 5 are connected in series by the plurality of lowerelectrodes 142 and the plurality of upper electrodes 143. It should beappreciated that the layers 151 to 154 of the MR films 150 may bestacked in an order reverse to that shown in FIG. 5.

As described previously, when the angle θ to be detected varies with thepredetermined period, the first and second signals S1 and S2 both varyperiodically with the signal period equal to the predetermined period.Ideally, each of the first and second signals S1 and S2 should have awaveform that traces a sinusoidal curve (including a sine waveform and acosine waveform). In actuality, however, the waveforms of the first andsecond signals S1 and S2 are distorted from a sinusoidal curve when, forexample, the magnetization direction of the magnetization pinned layer153 of the MR film 150 varies under the influence of the rotatingmagnetic field MF or like factors, or when the magnetization directionof the free layer 151 of the MR film 150 differs from the direction DMof the rotating magnetic field MF due to effects such as the shapeanisotropy of the free layer 151.

The distortion of the waveforms of the first and second signals S1 andS2 from a sinusoidal curve means that the first and second signals S1and S2 each contain an ideal component which varies periodically in sucha manner as to trace an ideal sinusoidal curve, and an error componentother than the ideal component. In the present embodiment, when theangle θ to be detected varies with the predetermined period, the firstsignal S1 contains a first ideal component S1 i and a first errorcomponent S1 c, and the second signal S2 contains a second idealcomponent S2 i and a second error component S2 e. The first idealcomponent S1 i and the second ideal component S2 i are different inphase from each other and vary periodically in such a manner as to tracean ideal sinusoidal curve.

In the example shown in FIG. 3, the first ideal component S1 i has acosine waveform dependent on the angle θ, and the second ideal componentS2 i has a sine waveform dependent on the angle θ. In this case, thephases of the first ideal component S1 i and the second ideal componentS2 i are different by π/2, i.e., 90°. Now, components of the anglesensor 1 other than the signal generator 2 will be described withreference to FIG. 4. The angle sensor 1 includes an angle detector 3 anda correction apparatus 4 shown in FIG. 4, in addition to the signalgenerator 2. FIG. 4 is a functional block diagram illustrating theconfiguration of the angle detector 3 and the correction apparatus 4.The angle detector 3 performs computations using the first signal S1 andthe second signal S2 to generate the detected angle value θs having acorrespondence with the angle θ to be detected.

The angle detector 3 includes a computing unit 31 for performingcomputations for generating the detected angle value θs. The correctionapparatus 4 includes a correction information generator 41 forgenerating correction information, and a correction processing unit 42.In the course of generation of the detected angle value θs by the angledetector 3, the correction processing unit 42 performs correctionprocessing the details of which are determined on the basis of thecorrection information. The correction processing unit 42 is thusincorporated in the angle detector 3.

A value corresponding to the detected angle value θs obtained when thecorrection processing is not performed will be referred to as anuncorrected detected angle value and denoted by symbol θp. A valuecorresponding to the detected angle value θs obtained when the firstsignal S1 does not contain the first error component S1 e, the secondsignal S2 does not contain the second error component S2 e, and thecorrection processing is not performed will be referred to as an idealangle estimate and denoted by symbol θc. The correction processing isprocessing for bringing the detected angle value θs closer to the idealangle estimate θc as compared with the uncorrected detected angle valueθp.

The correction information generator 41 includes: an error estimategeneration unit 411 for generating an error estimate E on the basis ofthe first and second signals S1 and S2; and a correction informationdetermination unit 412 for determining correction information on thebasis of the error estimate E. The error estimate E has a correspondencewith a difference between the uncorrected detected angle value θp andthe ideal angle estimate θc, i.e., θp minus θc. The error estimate Econtains a variable component Ev that varies depending on the idealangle estimate θc. The first signal S1 used at the correctioninformation generator 41 is the first signal S1 under the condition thatthe first signal S1 varies over time to contain the first idealcomponent S1 i and the first error component S1 e. Similarly, the secondsignal S2 used at the correction information generator 41 is the secondsignal S2 under the condition that the second signal S2 varies over timeto contain the second ideal component S2 i and the second errorcomponent S2 e.

The angle detector 3 and the correction apparatus 4 can be implementedby an application-specific integrated circuit (ASIC) or a microcomputer,for example.

Now, the operations of the angle detector 3 and the correction apparatus4 and a correction method for the angle sensor 1 according to thepresent embodiment will be described with reference to FIG. 4, FIG. 6and FIG. 7. The correction method according to the present embodimentincludes a step of generating correction information, and a step ofperforming correction processing, details of which are determined on thebasis of the correction information, in the course of generation of thedetected angle value θs by the angle detector 3. FIG. 6 is a flowchartof the step of generating the correction information. The step shown inFIG. 6 is executed before shipment or use of the angle sensor 1. FIG. 7is a flowchart of the operation of the angle detector 3. The operationshown in FIG. 7 includes the step of performing the correctionprocessing. The operation shown in FIG. 7 is executed while the anglesensor 1 is in use.

As shown in FIG. 6, the step of generating the correction informationincludes a first step S110 of generating the error estimate E on thebasis of the first and second signals S1 and S2, and a second step S120of determining the correction information on the basis of the errorestimate E. The first and second signals S1 and S2 used in the firststep S110 is the same as those used at the correction informationgenerator 41.

The first step S110 will now be described. The first step S110 isexecuted by the error estimate generation unit 411. The error estimategeneration unit 411 calculates the ideal angle estimate θc and theuncorrected detected angle value θp at specified time intervals on theassumption that the angular velocity of change in the angle θ to bedetected has a constant value. The uncorrected detected angle value θpis calculated on the basis of the first and second signals S1 and S2.The error estimate generation unit 411 uses the difference between theuncorrected detected angle value θp and the ideal angle estimate θc asthe error estimate E.

The first step S110 is executed under the condition that the angularvelocity of change in the angle θ to be detected can be assumed to havea constant value, i.e., under the condition that the angle θ to bedetected changes with a constant or almost constant angular velocity.This condition is fulfilled by rotating the magnet 5 with a constant oralmost constant angular velocity in the angle sensor system shown inFIG. 1. This condition can also be said to be the condition that thefirst signal S1 varies over time to contain the first ideal component S1i and the first error component S1 e and the second signal S2 variesover time to contain the second ideal component S2 i and the seconderror component S2 e.

In the first step S110, an estimate ω of the angular velocity of changein the angle θ is first obtained under the above-described condition.The estimate ω of the angular velocity may be obtained in the followingmanner, for example. Specifically, the uncorrected detected angle valueθp is calculated sequentially at specified time intervals T, and theangular velocity of change in the uncorrected detected angle value θp isalso calculated. Furthermore, an average of the calculated angularvelocities of change in the uncorrected detected angle value θp iscalculated. This processing is performed over a rather long period oftime, such as a period of time over which the uncorrected detected anglevalue θp changes by one period, i.e., 360°, and the angular velocitiesof change in the uncorrected detected angle value θp are averaged to usethe obtained average as the estimate ω of the angular velocity of changein the angle θ.

In the first step S110, after the estimate ω of the angular velocity isobtained, processing of sequentially calculating the ideal angleestimate ωc, the uncorrected detected angle value ωp, and the errorestimate E at specified time intervals T is performed under theabove-described condition. This processing is performed, for example,over a period of time over which the uncorrected detected angle value θpchanges by one period. Let θp(0) be the value of the uncorrecteddetected angle value θp at the point in time when θp is calculated forthe first time after the processing of sequentially calculating θc, θpand E is started. The values of θc and E at the point in time when θp(0)is calculated are not obtainable by calculation. In the presentembodiment, the values of θc and E at the point in time when θp(0) iscalculated are denoted as θc(0) and E(0), respectively. The value θc(0)is set to be equal to θp(0), and the value E(0) is set to 0.

The ideal angle estimate θc, the uncorrected detected angle value θp,and the error estimate E calculated at an i-th point in time after θp(0)is calculated are denoted as θc(i), θp(i), and E(i), respectively, wherei is an integer of 1 or more.

The error estimate generation unit 411 calculates θp by Equation (1)below.θp=a tan(S2/S1)  (1)

In Equation (1), a tan(S2/S1) represents arc tangent calculation toobtain θp, and S1 and S2 represent values of the first and secondsignals S1 and S2 at the point in time when θp is calculated. For θp inthe range of 0° to less than 360°, there are two solutions of θp inEquation (1) with a difference of 180° in value. Which of the twosolutions of θp in Equation (1) is the true value of θp can bedetermined from the combination of positive and negative signs on S1 andS2. More specifically, if S1 is positive in value, θp falls within arange that is greater than or equal to 0° and smaller than 90°, and arange that is greater than 270° and smaller than or equal to 360′. If S1is negative in value, θp is greater than 90° and smaller than 270°. IfS2 is positive in value, θp is greater than 0° and smaller than 180°. IfS2 is negative in value, θp is greater than 180° and smaller than 360°.Using Equation (1) and on the basis of the foregoing determination fromthe combination of positive and negative signs on S1 and S2, the errorestimate generation unit 411 determines θp within the range of 0° toless than 360°.

The error estimate generation unit 411 calculates θc(i) by Equation (2)below.θc(i)=θc(i−1)+ω·T  (2)

The error estimate generation unit 411 further calculates E(i) byEquation (3) below.E(i)=θp(i)−θc(i)  (3)

Now, the second step S120 will be described. The second step S120 isexecuted by the correction information determination unit 412. As shownin FIG. 6, the second step S120 includes: a step S121 of applying aFourier transform to a waveform that represents change in the errorestimate E with respect to change in the ideal angle estimate θc; and astep S122 of determining correction information on the basis of theresult of the step S121. The aforementioned waveform will hereinafter bereferred to as the waveform of the error estimate E.

First, the step S121 of applying the Fourier transform to the waveformof the error estimate E will be described. In the step S121, the Fouriertransform is applied to the waveform of the error estimate E on thebasis of θc(i) and E(i) which are calculated in the first step S110. Inthe present embodiment, the waveform of the error estimate E isexpressed by discretized data. Therefore, in the step S121, a discreteFourier transform (DFT) is applied to the waveform of the error estimateE. In this case, in the step S121, a frequency-domain function isobtained by product sum operation for each frequency expressed by aninteger equal to or greater than 0. In the step S121, an amplitude and aphase of the frequency-domain function of each frequency are obtained.

The step S121 may be executed after the error estimate E for one periodof the uncorrected detected angle value θp is obtained in the step S110,or may be executed simultaneously with the step S110. In the case wherethe step S121 is executed simultaneously with the step S110, the resultof product sum operation for obtaining a frequency-domain function ofeach frequency is updated in the step S121 whenever new error estimateE(i) is obtained in the step S110. By repeatedly executing this, thefrequency-domain function of each frequency is obtained in the step S121after a last error estimate E(i) is obtained in the step S110.

On the basis of the result of the Fourier transform in the step S121,the error estimate E is expressible by Equations (4A) and (4B) below. InEquation (4B), Ec is a constant value corresponding to the amplitude ofthe frequency-domain function of frequency 0 after the Fouriertransform.

$\begin{matrix}{\mspace{79mu}{E = {{Ec} + {Ev}}}} & \left( {4A} \right) \\{{Ev} = {{A_{1}{\cos\left( {{\theta\; c} - \alpha_{1}} \right)}} + {A_{2}\cos\left\{ \left( {{\theta\; c} - \alpha_{2}} \right) \right\}} + {A_{3}\cos\left\{ {3\left( {{\theta\; c} - \alpha_{3}} \right)} \right\}} + \ldots}} & \left( {4B} \right)\end{matrix}$

In the following description, the term “A_(n) cos {n(θc−α_(n))}” inEquation (4B) will be referred to as the n-th order component of theerror estimate E, n being an integer of 1 or more. Then, in the stepS121, an amplitude A_(n) and a phase α_(n) of the n-th order componentof the error estimate E are obtained. The amplitude A_(n) and the phaseα_(n) of the n-th order component of the error estimate E can beobtained from the amplitude and the phase of the frequency-domainfunction of frequency n after the Fourier transform.

The step S122 of determining correction information will now bedescribed. As described previously, in the step S122, correctioninformation is determined on the basis of the result of the step S121 ofapplying the Fourier transform. In the present embodiment, inparticular, in the step S122, correction information is determined onthe basis of the variable component Ev of the error estimate E indisregard of Ec corresponding to the amplitude of the function of thefrequency domain of frequency 0 after the Fourier transform.

The reason for disregarding Ec is as follows. As described previously,in the first step S110, the value E(0) of the error estimate E at thepoint in time when θp(0) is calculated is set to 0 regardless of thevalue of an actual error, i.e., the difference between the uncorrecteddetected angle value θp and the angle θ to be detected. Due to thisprocessing, Ec varies depending on the point in time at which θp(0) iscalculated. As described later in detail, the present embodiment reducesthe angle-dependent error. The value Ec is unrelated to theangle-dependent error. It is the variable component Ev of the errorestimate E that is related to the angle-dependent error. For thisreason, in the present embodiment the correction information isdetermined on the basis of the variable component Ev in disregard of Ec.

In the present embodiment, the correction information includes firstcorrection information and second correction information. The firsterror component S1 c of the first signal S1 is expressible as a Fourierseries by Equation (5). The first correction information contains one ormore coefficients among a plurality of coefficients a₁₁, a₁₂, a₁₃, a₁₄,. . . , b₁₁, b₁₂, b₁₃, b₁₄, obtained when the first error component S1 cis expressed as a Fourier series by Equation (5). Similarly, the seconderror component S2 e of the second signal S2 is expressible as a Fourierseries by Equation (6). The second correction information contains oneor more coefficients among a plurality of coefficients a₂₁, a₂₂, a₂₃,a₂₄, . . . , b₂₁, b₂₂, b₂₃, b₂₄, . . . obtained when the second errorcomponent S2 e is expressed as a Fourier series by Expression (6),

$\begin{matrix}{{S\; 1e} = {{a_{11}\cos\;\theta\; c} + {b_{11}\sin\;\theta\; c} + \;{a_{12}\cos\; 2\;\theta\; c} + {b_{12}\sin\;\theta\; c} + {a_{13}\cos\; 3\theta\; c} + {b_{13}\sin\; 3\theta\; c} + {a_{14}\cos\; 4\theta\; c} + {b_{14}\sin\; 4\;\theta\; c} + \ldots}} & (5) \\{{S\; 2e} = {{a_{21}\cos\;\theta\; c} + {b_{21}\sin\;\theta\; c} + \;{a_{22}\cos\; 2\;\theta\; c} + {b_{22}\sin\;\theta\; c} + {a_{23}\cos\; 3\theta\; c} + {b_{23}\sin\; 3\theta\; c} + {a_{24}\cos\; 4\;\theta\; c} + {b_{24}\sin\; 4\theta\; c} + \ldots}} & (6)\end{matrix}$

In the step S122, the first correction information and the secondcorrection information are calculated on the basis of the amplitudeA_(n) and the phase α_(n) of the n-th order component of the errorestimate E obtained in the step S121.

Hereinafter, coefficients of cos(mθc) and sin(mθc) in Equation (5) willbe represented by symbols a_(1m) and b_(1m), respectively, andcoefficients of cos(mθc) and sin(mθc) in Equation (6) will berepresented by symbols a_(2m) and b_(2m), respectively, where m is aninteger of 1 or more.

A method for calculating the coefficients a_(1m), b_(1m), a_(2m), andb_(2m) will be described by taking as an example a case where thevariable component Ev of the error estimate E contains only thesecond-order component A₂ cos {2(θc−α₂)} of the error estimate E. Assumehere that the first ideal component S1 i of the first signal S1 has acosine waveform dependent on the ideal angle estimate θc. In this case,the first error component S1 e of the first signal S1 is expressed byEquation (7) below.

$\begin{matrix}{\begin{matrix}{{S\; 1e} = {{S\; 1} - {S\; 1i}}} \\{= {{\cos\left( {{\theta\; c} + E} \right)} - {\cos\;\theta\; c}}} \\{= {{\cos\;\theta\;{c \cdot \cos}\; E} - {\sin\;\theta\;{c \cdot \sin}\; E} - {\cos\;\theta\; c}}}\end{matrix}\quad} & (7)\end{matrix}$

When x is small enough, cos x and sin x can be approximated to 1 and x,respectively. In the present embodiment, the error estimate E is a valuesmall enough to approximate cos E and sin E to 1 and E, respectively.When this approximation is applied to Equation (7), the first errorcomponent S1 e is expressed by Equation (8) below.

$\begin{matrix}{\begin{matrix}{{S\; 1e} \approx {{\cos\;{\theta c}} - {\sin\;{{\theta c} \cdot E}} - {\cos\;{\theta c}}}} \\{= {{- \sin}\;\theta\;{c \cdot E}}} \\{= {{- \sin}\;{{\theta c} \cdot A_{2}}\cos\left\{ {2\left( {{\theta c} - \alpha_{2}} \right)} \right\}}} \\{= {{- A_{2}}{\left\{ {{\sin\left( {{3\theta\; c} - {2\alpha_{2}}} \right)} + {\sin\left( {{{- \theta}\; c} + {2\alpha_{2}}} \right)}} \right\}/2}}} \\{= {{{- A_{2}}{\left\{ {{\sin\; 3\theta\;{c \cdot \cos}\; 2\alpha_{2}} - {\cos\; 3\theta\;{c \cdot \sin}\; 2\alpha_{2}}} \right\}/2}} +}} \\{A_{2}{\left\{ {{\sin\;\theta\;{c \cdot \cos}\; 2\alpha_{2}} - {\cos\;\theta\;{c \cdot \sin}\; 2\alpha_{2}}} \right\}/2}} \\{= {{{\left\{ {\left( {{- A_{2}}\sin\; 2\alpha_{2}} \right)/2} \right\} \cdot \cos}\;\theta\; c} + {{\left\{ {\left( {A_{2}\cos\; 2\alpha_{2}} \right)/2} \right\} \cdot \sin}\;\theta\; c} +}} \\{{{\left\{ {\left( {A_{2}\sin\; 2\alpha_{2}} \right)/2} \right\} \cdot \cos}\; 3\theta\; c} + {{\left\{ {\left( {{- A_{2}}\cos\; 2\alpha_{2}} \right)/2} \right\} \cdot \sin}\; 3\theta\; c}}\end{matrix}\quad} & (8)\end{matrix}$

By comparing Equations (5) and (8), the coefficients a_(1m) and b_(1m)are obtained as follows.

-   -   a₁₁=(−A₂ sin 2α₂)/2    -   b₁₁=(A₂ cos 2α₂)/2    -   a₁₂=0    -   b₁₂=0    -   a₁₃=(A₂ sin 2α₂)/2    -   B₁₃=(−A₂ cos 2α₂)/2    -   a₁₄=0    -   b₁₄=0

The values A₂ and α₂ have been obtained in the step S121. Thecoefficients a₁₁, b₁₁, a₁₃, and b₁₃ can thus be calculated using A₂ andα₂.

Assume that the second ideal component S2 i of the second signal S2 hasa sine waveform dependent on the ideal angle estimate θc. In this case,by transforming the equation expressing the second error component S2 eof the second signal S2 in the same manner as Equation (8), the seconderror component S2 e is expressible by Equation (9) below.

$\begin{matrix}{\begin{matrix}{{S\; 2e} \approx {{\sin\;\theta\; c} + {\cos\;\theta\;{c \cdot E}} - {\sin\;\theta\; c}}} \\{= {{{\left\{ {\left( {A_{2}\cos\;{2/}} \right)2} \right\} \cdot \cos}\;\theta\; c} + {{\left\{ {\left( {A_{2}\sin\; 2\alpha_{2}} \right)/2} \right\} \cdot \sin}\;\theta\; c} +}} \\{{{\left\{ {\left( {A_{2}\cos\; 2\alpha_{2}} \right)/2} \right\} \cdot \cos}\; 3\theta\; c} + {{\left\{ {\left( {A_{2}\sin\; 2\alpha_{2}} \right)/2} \right\} \cdot \sin}\; 3\theta\; c}}\end{matrix}\quad} & (9)\end{matrix}$

By comparing Equations (9) and (6), the coefficients a_(2m) and b_(2m)are obtained as follows.

-   -   a₂₁=(A₂ cos 2α₂)/2    -   b₂₁=(A₂ sin 2α₂)/2    -   a₂₂=0    -   b₂₂=0    -   a₂₃=(A₂ cos 2α₂)/2    -   b₂₃=(A₂ sin 2α₂)/2    -   a₂₄=0    -   b₂₄=0

As described above, the values A₂ and a₂ have been obtained in the stepS121. The coefficients a₂₁, b₂₁, a₂₃, and b₂₃ can thus be calculatedusing A₂ and α₂.

Not only in the case where the variable component Ev of the errorestimate E contains only the second-order component of the errorestimate E, but also in the case where the variable component Ev of theerror estimate E contains a plurality of different n-th order componentsof the error estimate E, the coefficients a_(1m), b_(1m), a_(2m), andb_(2m) can be calculated using the amplitude A_(n) and the phase α_(n)of the plurality of different n-th order components. For example, whenthe variable component Ev of the error estimate E contains a first-ordercomponent A₁ cos(θc−α₁), a second-order component A₂ cos {2(θc−α₂)} anda third-order component A₃ cos {3(θc−α₃)}, the coefficients a_(1m) andb_(1m) are expressed as below. The values A₁ to A₃, and α₁ to α₃ havebeen obtained in the step S121. The coefficients a₁₁ to a₁₄ and b₁₁ tob₁₄ can thus be calculated using A₁ to A₃, and α₁ to α₃.

-   -   a₁₁=(A₂ sin 2α₂)/2    -   b₁₁=(A₂ cos 2α₂)/2    -   a₁₂=(A₁ sin α₁−A₃ sin 3α₃)/2    -   b₁₂=(A₁ cos α₁+A₃ cos 3α₃)/2    -   a₁₃=(A₂ sin 2α₂)/2    -   b₁₃=(A₂ cos 2α₂)/2    -   a₁₄=(A₃ sin 3α₃)/2    -   b₁₄=(A₃ cos 3α₃)/2

Likewise, the coefficients a_(2m) and b₂, are expressed as follows. Thevalues A₁ to A₃, and α₁ to α₃ have been obtained in the step S121. Thecoefficients a₂₁ to a₂₄ and b₂₁ to b₂₄ can thus be calculated using A₁to A₃, and α₁ to α₃.

-   -   a₂₁ (A₂ cos 2α₂)/2    -   b₂₁=(A₂ sin 2α₂)/2    -   a₂₂=(A₁ cos α₁+A₃ cos 3α₃)/2    -   b₂₂=(A₁ sin α₁+A₃ sin 3α₃)/2    -   a₂₃ (A₂ cos 2α₂)/2    -   b₂₃=(A₂ sin 2α₂)/2    -   a₂₄=(A₃ cos 3α₃)/2    -   b₂₄=(A₃ sin 3α₃)/2

The correction information is determined by calculating the coefficientsa_(1m), b_(1m), a_(2m), and b_(2m) in the above-described manner. Thefollowing description assumes that the first correction informationcontains all the calculated coefficients a_(1m) and b_(1m), and thesecond correction information contains all the calculated coefficientsa_(2m) and b_(2m). Once the correction information is determined, thedetails of the correction processing in the step of performing thecorrection processing are also determined. As mentioned before, the stepof generating the correction information illustrated in FIG. 6 isexecuted before shipment or use of the angle sensor 1. Therefore, thedetails of the correction processing are determined before use of theangle sensor 1.

The operation of the angle detector 3 will now be described withreference to FIG. 7. The operation illustrated in FIG. 7 starts withexecuting a step S200 of performing correction processing. The step S200of performing correction processing is executed by the correctionprocessing unit 42. In the present embodiment, the correction processingis processing for correcting the first and second signals S1 and S2. Asshown in FIG. 7, the step S200 of performing the correction processingincludes a step S201 of calculating an estimate Ep1 of the first errorcomponent S1 e and an estimate Ep2 of the second error component S2 e,and a step S202 of correcting the first and second signals S1 and S2.The first and second signals S1 and S2 used at the correction processingunit 4 and in the step S200 are those when the angle sensor 1 is in use.

The step S201 of calculating the estimates Ep1 and Ep2 will now bedescribed. The correction processing unit 42 determines the estimatesEp1 and Ep2 using the first and second signals S1 and S2 before thecorrection processing, the first correction information or thecoefficients a_(1m) and b_(1m), and the second correction information orthe coefficients a_(2m) and b_(2m). The estimate Ep1 is expressed byEquation (10). The estimate Ep2 is expressed by Equation (11).

$\begin{matrix}{{{Ep}\; 1} = {{a_{11}\cos\;\theta\; p} + {b_{11}\sin\;\theta\; p} + {a_{12}\cos\; 2\theta\; p} + {b_{12}\sin\; 2\theta\; p} + {a_{13}\cos\; 3\theta\; p} + {b_{13}\sin\; 3\theta\; p} + {a_{14}\cos\; 4\theta\; p} + {b_{14}\sin\; 4\theta\; p} + \ldots}} & (10) \\{{{Ep}\; 2} = {{a_{21}\cos\;\theta\; p} + {b_{21}\sin\;\theta\; p} + {a_{22}\cos\; 2\theta\; p} + {b_{22}\sin\; 2\theta\; p} + {a_{23}\cos\; 3\theta\; p} + {b_{23}\sin\; 3\theta\; p} + {a_{24}\cos\; 4\theta\; p} + {b_{24}\sin\; 4\theta\; p} + \ldots}} & (11)\end{matrix}$

The right-hand side of Equation (10) is the same as the right-hand sideof Equation (5) expressing the first error component S1 e, except thatthe ideal angle estimate θc is replaced with the uncorrected detectedangle value θp. The right-hand side of Equation (11) is the same as theright-hand side of Equation (6) expressing the second error component S2e, except that the ideal angle estimate θc is replaced with theuncorrected detected angle value θp. The value of the first errorcomponent S1 e obtained from Equation (5) by replacing the ideal angleestimate θc with the uncorrected detected angle value θp, and the valueof the first error component Sic obtained from Equation (5) on the basisof the ideal angle estimate θc differ very slightly from each other.Similarly, the value of the second error component S2 e obtained fromEquation (6) by replacing the ideal angle estimate θc with theuncorrected detected angle value θp, and the value of the second errorcomponent S2 e obtained from Equation (6) on the basis of the idealangle estimate θc differ very slightly from each other. Thus, theestimates Ep1 and Ep2 obtained by Equations (10) and (11) havesufficient precision.

The correction processing unit 42 may obtain the uncorrected detectedangle value θp from the first and second signals S1 and S2 before thecorrection processing using Equation (1), and may obtain the estimatesEp1 and Ep2 by substituting θp for Equations (10) and (11).

Alternatively, the correction processing unit 42 may obtain theestimates Ep1 and Ep2 without obtaining the uncorrected detected anglevalue θp as described below. First, cos θp and sin θp in the right-handside of Equation (10) and the right-hand side of Equation (11) are avalue of the first signal S1 before the correction processing and avalue of the second signal S2 before the correction processing,respectively. The terms of the second- or higher-order components in theright-hand side of Equation (10) and in the right-hand side of Equation(11) may be expressed with cos θp and sin θp by using formulas such as adouble-angle formula and a triple angle formula of trigonometricfunctions. For example, cos 2θp, sin 2θp, cos 3θp, sin 3θp, cos 4θp, andsin 4θp are expressed by Equations (12A), (12B), (12C), (12D), (12E),and (12F) below, respectively.cos 2θp=cos² θp−sin² θp  (12A)sin 2θp=2 sin θp·cos θp  (12B)cos 3θp=4 cos³ θp−3 cos θp  (12C)sin 3θp=3 sin θp−4 sin³ θp  (12D)cos 4θp=8 cos⁴ θp−8 cos² θp+1  (12E)sin 4θp=cos θp·(4 sin θp−8 sin³ θp)  (12F)

The estimates Ep1 and Ep2 can thus be calculated by using the value cosθp of the first signal S1 before the correction processing, the valuesin θp of the second signal S2 before the correction processing, thefirst correction information or the coefficients a_(1m) and b_(1m), andthe second correction information or the coefficients a_(2m) and b_(2m).

Now, the step S202 of correcting the first and second signals S1 and S2will be described. The correction processing unit 42 subtracts theestimate Ep1 of the first error component Sic from the first signal S1before the correction processing to thereby generate a corrected firstsignal Sa1, and subtracts the estimate Ep2 of the second error componentS2 e from the second signal S2 before the correction processing tothereby generate a corrected second signal Sa2. The corrected first andsecond signals Sa1 and Sa2 are expressed by Equations (13A) and (13B)below.Sa1=S1−Ep1  (13A)Sa2=S2−Ep2  (13B)

Next, a step S300 of generating the detected angle value θs will bedescribed. The step S300 is executed by the computing unit 31 of theangle detector 3. The computing unit 31 calculates the detected anglevalue θs, which has a correspondence with the angle θ, on the basis ofthe corrected first and second signals Sa1 and Sa2. More specifically,the computing unit 31 calculates θs by Equation (14) below, for example.Note that “a tan” in Equation (14) represents arctangent.θs=a tan(Sa2/Sa1)  (14)

In Equation (14), a tan(Sa2/Sa1) represents arc tangent calculation toobtain θs. For θs in the range of 0° to less than 360°, there are twosolutions of θs in Equation (14) with a difference of 180° in value.Which of the two solutions of θs in Equation (14) is the true value ofθs can be determined from the combination of positive and negative signson Sa1 and Sa2. The relationship between the true value of θs and thecombination of positive and negative signs on Sa1 and Sa2 is the same asthe previously mentioned relationship between the true value of θp andthe combination of positive and negative signs on S1 and S2.

As described previously, the present embodiment reduces theangle-dependent error. The angle-dependent error is an error that occursin the detected angle value θs generated on the basis of the first andsecond signals S1 and S2 due to errors occurring in the same phase inthe first and second signals S1 and S2. More specifically, theangle-dependent error occurs, depending on the angle θ to be detected,when the first signal S1 and the second signal S2 deviate from the firstideal component S1 i and the second ideal component S2 i, respectively,by the magnitude corresponding to the angle-dependent error. While theangle-dependent error varies depending on the angle θ to be detected, itdoes not cause fluctuation in the magnitude of a square-sum signal madeup of the sum of the square of the first signal S1 and the square of thesecond signal S2. Here, the angle-dependent error occurring in thedetected angle value θs when the correction processing of the presentembodiment is not performed will be denoted as θe. For example, theangle-dependent error θe occurs when the free layer 151 of the MR film150 in the first detection circuit 10 and the free layer 151 of the MRfilm 150 in the second detection circuit 20 have magnetic anisotropiesin the same direction, or when there is a misalignment of relativepositions of the magnet 5 and the signal generator 2 with respect toeach other. Neither of the techniques disclosed in U.S. PatentApplication Publication Nos. 2012/0095712 A1 and 2006/0076480 A1 canreduce the angle-dependent error.

Now, a description will be given of the first signal S1 and the secondsignal S2 in the case where the angle-dependent error θe is the onlyerror occurring in the detected angle value θs. First, theangle-dependent error θe is expressible by Equation (15) below, which issimilar to Equation (4B).

$\begin{matrix}{{\theta\; e} = {{A_{01}{\cos\left( {\theta - \alpha_{01}} \right)}} + {A_{02}\cos\left\{ {2\left( {\theta - \alpha_{02}} \right)} \right\}} + {A_{03}\cos\left\{ {3\left( {\theta - \alpha_{03}} \right)} \right\}} + \ldots}} & (15)\end{matrix}$

FIG. 8 illustrates an example of waveform of the angle-dependent errorθe. In FIG. 8, the horizontal axis represents the angle θ, and thevertical axis represents the angle-dependent error θe. The example shownin FIG. 8 is where the angle-dependent error θe is 0.1 cos {2(θ−45°)}.

When the angle-dependent error θe is the only error occurring in thedetected angle value θs, the first signal S1 and the second signal S2are expressible as cos(θ+θe) and sin(θ+θe), respectively. In this case,the square-sum signal is expressed by Equation (16) below.S1² +S2²=cos²(θ+θe)+sin²(θ+θe)=1  (16)

FIG. 9 illustrates the waveform of the square-sum signal in the casewhere the angle-dependent error θe is the only error occurring in thedetected angle value θs. In FIG. 9, the horizontal axis represents theangle θ, and the vertical axis represents the value of the square-sumsignal. As is clear from Equation (16) and FIG. 9, when theangle-dependent error θe is the only error occurring in the detectedangle value θs, the value of the square-sum signal is constantregardless of the value of the angle θ. Thus, the angle-dependent errorθe does not cause fluctuation in the magnitude of the square-sum signal.Both of the techniques disclosed in U.S. Patent Application PublicationNos. 2012/0095712 A1 and 2006/0076480 A1 relate to correction performedto reduce fluctuation in the magnitude of the square-sum signal. Thus,neither of these techniques can reduce the angle-dependent error θe.

In the present embodiment, the error estimate E having a correspondencewith the difference between the uncorrected detected angle value θp andthe ideal angle estimate θc is generated on the basis of the first andsecond signals S1 and S2, and correction information is determined onthe basis of the generated error estimate E to perform correctionprocessing the details of which are determined on the basis of thecorrection information. In the correction processing, the estimate Ep1of the first error component S1 c is subtracted from the first signal S1before the correction processing to thereby generate the corrected firstsignal Sa1, and the estimate Ep2 of the second error component S2 e issubtracted from the second signal S2 before the correction processing tothereby generate the corrected second signal Sa2. The variable componentEv of the error estimate E is thereby reduced. The variable component Evexpressed by Equation (4B) can be said to be an estimate of theangle-dependent error θe expressed by Equation (15). Thus, the presentembodiment achieves a reduction in the angle-dependent error after thecorrection processing.

FIG. 10 is a waveform diagram illustrating the effect of the presentembodiment. In FIG. 10, the horizontal axis represents the angle θ to bedetected. In FIG. 10, the vertical axis represents error thatcollectively represents both the error estimate E obtained in the firststep S110 and the angle-dependent error in the detected angle value Os.In FIG. 10, the reference numeral 71 denotes one example of waveform ofthe error estimate E, and the reference numeral 72 denotes one exampleof waveform of the angle-dependent error in the detected angle value θs.It can be said that in the example illustrated in FIG. 10, thedifference between the maximum value and the minimum value in thewaveform of the error estimate E is an estimate of the differencebetween the maximum value and the minimum value in the angle-dependenterror θe in the case where the correction processing is not performed.The value thereof is approximately 0.45°. In contrast, the differencebetween the maximum value and the minimum value in the waveform of theangle-dependent error in the detected angle value θs is approximately0.13°. The present embodiment thus achieves a reduction in theangle-dependent error.

Second Embodiment

A second embodiment of the invention will now be described. First, theconfiguration of the angle detector 3 of the second embodiment will bedescribed with reference to FIG. 11. FIG. 11 is a functional blockdiagram illustrating the angle detector 3 and the correction apparatus4. Of the computing unit 31 and the correction processing unit 42described in relation to the first embodiment, only the correctionprocessing unit 42 is provided in the angle detector 3 of the secondembodiment. The correction processing unit 42 is incorporated in theangle detector 3. As will be described later, in the second embodimentthe computations for generating the detected angle value θs areperformed by the correction processing unit 42.

Now, with reference to FIG. 11 and FIG. 12, a description will be givenof the operations of the angle detector 3 and the correction apparatus 4and the correction method for the angle sensor 1 according to thepresent embodiment. The correction method according to the presentembodiment includes the step of performing correction processing thedetails of which are determined on the basis of correction information,instead of the step S200 of performing correction processing of thefirst embodiment. FIG. 12 is a flowchart of the step of performingcorrection processing.

In the correcting method according to the present embodiment, the stepof generating the correction information is basically similar to that inthe first embodiment described with reference to FIG. 6. However, in thepresent embodiment, the step S122 of determining the correctioninformation is different from that in the first embodiment. In thepresent embodiment, the correction information is information thatdefines a waveform representing change in the variable component Ev ofthe error estimate E with respect to change in the ideal angle estimateθc. The variable component Ev is expressed by Equation (4B) presentedpreviously. In the step S122 of determining the correction information,the amplitude A_(n) and the phase α_(n) obtained in the step S121 ofapplying the Fourier transform illustrated in FIG. 6 are used as thecorrection information.

The step of performing the correction processing shown in FIG. 12 isexecuted by the correction processing unit 42 after the step S122 ofdetermining the correction information. The step of performing thecorrection processing includes a step S401 of calculating theuncorrected detected angle value θp on the basis of the first and secondsignals S1 and S2, and a step S402 of generating the detected anglevalue θs by correcting the uncorrected detected angle value θp. Thefirst and second signals S1 and S2 used at the correction processingunit 42 and in the step of performing the correction processing arethose when the angle sensor 1 is in use.

In the step S401 of calculating the uncorrected detected angle value θp,the correction processing unit 42 calculates the uncorrected detectedangle value θp on the basis of the first and second signals S1 and S2 byEquation (1) presented previously.

The following are first to third examples of the step S402 of generatingthe detected angle value θs. The first example of the step S402 will bedescribed first. In the first example, before the step S402, a tableindicating correspondence between the uncorrected detected angle valueθp and the detected angle value θs is prepared in advance at specifiedangle intervals of the detected angle value θs on the basis of thecorrection information, i.e., the amplitude A_(n) and phase α_(n) of then-th order component of the error estimate E. The specified angleintervals may or may not coincide with ω·T in Equation (1) described inrelation to the first embodiment. In the aforementioned table, the i-thcorresponding θp and θs are denoted as θpa(i) and θsa(i), respectively,where i is an integer of 0 or more. Each of θpa(0) and θsa(0) takes avalue of 0. The value of θsa(i) is in the range of 0° to less than 360°.The relationship between θpa(i) and θsa(i) is expressed by Equation (17)below.θpa(i)=θsa(i)+Eva(i)  (17)

In Equation (17), Eva(i) is a value of Ev obtained by replacing theideal angle estimate θc with θsa(i) in Equation (4B) presentedpreviously.

When the angle sensor 1 is in use, the correction processing unit 42obtains the detected angle value θs corresponding to the uncorrecteddetected angle value θp calculated in the step S401 by using linearinterpolation on the basis of the aforementioned table. Morespecifically, the correction processing unit 42 obtains the detectedangle value θs corresponding to the uncorrected detected angle value θpby using linear interpolation on the basis of θsa(i) corresponding toθpa(i) before and after the uncorrected detected angle value θp. Whenthe uncorrected detected angle value θp matches with a specific θpa(i),the detected angle value θs is θsa(i) corresponding to the specificθpa(i). When θp is other than θpa(i), the detected angle value θs is avalue estimated by linear interpolation.

Next, the second example of the step 402 will be described. In thesecond example, the correction processing unit 42 first obtains acorrection value Cv corresponding to the uncorrected detected anglevalue θp by using the correction information, i.e., the amplitude A_(n)and the phase α_(n) of the nth order component of the error estimate E.The correction value Cv is a value of Ev obtained by replacing the idealangle estimate θc with OP in Equation (4B) presented previously. Thecorrection processing unit 42 uses a value obtained by adding thecorrection value Cv to the uncorrected detected angle value θp as thedetected angle value θs.

The value of Ev obtained by replacing the ideal angle estimate θc withθp in Equation (4B) and the value of Ev obtained from Equation (4B) onthe basis of the ideal angle estimate θc differ very slightly from eachother. Thus, the detected angle value θs obtained by the second examplehas sufficient precision.

Next, the third example of the step 402 will be described. In the thirdexample, the correction processing unit 42 obtains the correction valueCv corresponding to the uncorrected detected angle value θp as in thesecond example. However, in the third example, the correction processingunit 42 obtains the correction value Cv by Equation (18) below. Theright-hand side of Equation (18) is obtained by replacing the idealangle estimate θc with θp in Equation (4B) presented previously, andfurther developing the same.

$\begin{matrix}{{Cv} = {{A_{1}\left\{ {{\cos\;\theta\;{p \cdot \cos}\;\alpha_{1}} + {\sin\;\theta\;{p\; \cdot \sin}\;\alpha_{1}}} \right\}} + {A_{2}\left\{ {{\cos\; 2\theta\;{p \cdot \cos}\; 2\alpha_{2}} + {\sin\; 2\theta\;{p \cdot \sin}\; 2\alpha_{2}}} \right\}} + {A_{3}\left\{ {{\cos\; 3\theta\;{p \cdot \cos}\; 3\alpha_{3}} + {\sin\; 3\theta\;{p \cdot \sin}\; 3\alpha_{3}}} \right\}} + \ldots}} & (18)\end{matrix}$

As described in relation to the first embodiment, cos θp and sin θp inthe right-hand side of Equation (18) are a value of the first signal S1before the correction processing and a value of the second signal S2before the correction processing, respectively. The ter us of thesecond- or higher-order components in the right-hand side of Equation(18) are expressible using cos θp and sin θp. In the third example, thecorrection processing unit 42 calculates the correction value Cv byusing the value cos θp of the first signal S1 before the correctionprocessing, the value sin θp of the second signal S2 before thecorrection processing, and the amplitude A_(n) and the phase α_(n) of aplurality of different n-th order components of the error estimate E. Asa result, when calculating the detected angle value θs, it is possibleto omit arithmetic calculation of the cosine function in the equationobtained by replacing the ideal angle estimate θc with θp in Equation(4B).

The other configuration, operation, and effects of the second embodimentare the same as those of the first embodiment.

The present invention is not limited to the foregoing embodiments, andvarious modifications may be made thereto. For example, in the anglesensor of the present invention, not only the correction processing forreducing the angle-dependent error by the correction apparatus of thepresent invention, but also additional correction processing forreducing an error other than the angle-dependent error occurring in thedetected angle value may be performed. The additional correctionprocessing may be processing for changing the detected angle value,which has been corrected by the correction processing that reduces theangle-dependent error, by a fixed value to thereby generate a newdetected angle value.

The present invention is applicable not only to magnetic angle sensorsbut to all types of angle sensors including optical angle sensors.

Obviously, many modifications and variations of the present inventionare possible in the light of the above teachings. Thus, it is to beunderstood that, within the scope of the appended claims and equivalentsthereof, the invention may be practiced in other than the foregoing mostpreferable embodiments.

What is claimed is:
 1. A correction apparatus comprising: an anglesensor including: a signal generator for generating a first signal and asecond signal each having a correspondence with an angle to be detected;and an angle detector for generating a detected angle value byperforming computations using the first signal and the second signal,the detected angle value having a correspondence with the angle to bedetected, when the angle to be detected varies with a predeterminedperiod, the first signal contains a first ideal component and a firsterror component, and the second signal contains a second ideal componentand a second error component, and the first ideal component and thesecond ideal component are different in phase from each other and varyperiodically in such a manner as to trace an ideal sinusoidal curve; acorrection information generator for generating correction information;and a correction processor for performing correction processing in acourse of generation of the detected angle value by the angle detector,details of the correction processing being determined based on thecorrection information, wherein the correction processing is processingfor bringing the detected angle value closer to an ideal angle estimateas compared with an uncorrected detected angle value, the ideal angleestimate corresponding to the detected angle value obtained when thefirst signal does not contain the first error component, the secondsignal does not contain the second error component and the correctionprocessing is not performed, the uncorrected detected angle valuecorresponding to the detected angle value obtained when the correctionprocessing is not performed, the correction information generator is aprocessor for performing: first processing of generating an errorestimate based on the first signal and the second signal under acondition that the first signal varies over time to contain the firstideal component and the first error component and the second signalvaries over time to contain the second ideal component and the seconderror component, the error estimate having a correspondence with adifference between the uncorrected detected angle value and the idealangle estimate and containing a variable component that varies dependingon the ideal angle estimate; and second processing of determining thecorrection information based on the error estimate, the first processingincludes processing of sequentially calculating the ideal angleestimate, the uncorrected detected angle value and the error estimate atspecified time intervals T on an assumption that an angular velocity ofchange in the angle to be detected has a constant value, wherein theuncorrected detected angle value is calculated based on the first andsecond signals, and the error estimate is the difference between theuncorrected detected angle value and the ideal angle estimate, theprocessing of sequentially calculating the ideal angle estimate, theuncorrected detected angle value and the error estimate assumes thatθp(0) represents a value of the uncorrected detected angle value at apoint in time when the uncorrected detected angle value is calculatedfor the first time after the processing of sequentially calculating isstarted, and that θc(0) represents a value of the ideal angle estimateat the point in time when θp(0) is calculated, and then calculates θc(i)and E(i) as θc(i)=θc(i−1)+ω·T and E(i)=θp(i)−θc(i), respectively, whereθc(i), θp(i), and E(i) respectively represent the ideal angle estimate,the uncorrected detected angle value, and the error estimate that arecalculated at an i-th point in time after θp(0) is calculated, where iis an integer of 1 or more, and where w represents an estimate of theangular velocity of change in the angle to be detected, and thecorrection processing is processing for correcting the first and secondsignals.
 2. The correction apparatus according to claim 1, wherein theangle to be detected is an angle that a direction of a rotating magneticfield in a reference position forms with respect to a referencedirection.
 3. The correction apparatus according to claim 1, wherein thefirst ideal component and the second ideal component are different inphase from each other by 90°.
 4. The correction apparatus according toclaim 1, wherein in the first processing, prior to the processing ofsequentially calculating the ideal angle estimate, the uncorrecteddetected angle value and the error estimate, the uncorrected detectedangle value is calculated sequentially at specified time intervals T,and an average of angular velocities of change in the uncorrecteddetected angle value is calculated to use the average as the estimate ωof the angular velocity of change in the angle to be detected.
 5. Thecorrection apparatus according to claim 1, wherein the correctioninformation includes first correction information and second correctioninformation, the first correction information containing one or morecoefficients among a plurality of coefficients provided to express thefirst error component as a Fourier series, the second correctioninformation containing one or more coefficients among a plurality ofcoefficients provided to express the second error component as a Fourierseries, the second processing applies a Fourier transform to a waveformrepresenting change in the error estimate with respect to change in theideal angle estimate, and determines the first and second correctioninformation based on a result thereof, and in the correction processing,an estimate of the first error component and an estimate of the seconderror component are obtained using the first and second signals beforethe correction processing and the first and second correctioninformation, the estimate of the first error component is subtractedfrom the first signal before the correction processing to therebygenerate a corrected first signal, and the estimate of the second errorcomponent is subtracted from the second signal before the correctionprocessing to thereby generate a corrected second signal.
 6. Acorrection method comprising: a step of providing an angle sensorincluding: a signal generator for generating a first signal and a secondsignal each having a correspondence with an angle to be detected; and anangle detector for generating a detected angle value by performingcomputations using the first signal and the second signal, the detectedangle value having a correspondence with the angle to be detected, whenthe angle to be detected varies with a predetermined period, the firstsignal contains a first ideal component and a first error component, andthe second signal contains a second ideal component and a second errorcomponent, and the first ideal component and the second ideal componentare different in phase from each other and vary periodically in such amanner as to trace an ideal sinusoidal curve; a step of generatingcorrection information; and a step of performing correction processingin a course of generation of the detected angle value by the angledetector, details of the correction processing being determined based onthe correction information, wherein the correction processing isprocessing for bringing the detected angle value closer to an idealangle estimate as compared with an uncorrected detected angle value, theideal angle estimate corresponding to the detected angle value obtainedwhen the first signal does not contain the first error component, thesecond signal does not contain the second error component and thecorrection processing is not performed, the uncorrected detected anglevalue corresponding to the detected angle value obtained when thecorrection processing is not performed, the step of generating thecorrection information includes: a first step of generating an errorestimate based on the first signal and the second signal under acondition that the first signal varies over time to contain the firstideal component and the first error component and the second signalvaries over time to contain the second ideal component and the seconderror component, the error estimate having a correspondence with adifference between the uncorrected detected angle value and the idealangle estimate and containing a variable component that varies dependingon the ideal angle estimate; and a second step of determining thecorrection information based on the error estimate, the first stepincludes performing processing of sequentially calculating the idealangle estimate, the uncorrected detected angle value and the errorestimate at specified time intervals T on an assumption that an angularvelocity of change in the angle to be detected has a constant value,wherein the uncorrected detected angle value is calculated based on thefirst and second signals, and the error estimate is the differencebetween the uncorrected detected angle value and the ideal angleestimate, the processing of sequentially calculating the ideal angleestimate, the uncorrected detected angle value and the error estimateassumes that θp(0) represents a value of the uncorrected detected anglevalue at a point in time when the uncorrected detected angle value iscalculated for the first time after the processing of sequentiallycalculating is started, and that θc(0) represents a value of the idealangle estimate at the point in time when θp(0) is calculated, and thencalculates θc(i) and E(i) as θc(i)=θc(i−1)+ω·T and E(i)=θp(i)−θc(i),respectively, where θc(i), θp(i), and E(i) respectively represent theideal angle estimate, the uncorrected detected angle value, and theerror estimate that are calculated at an i-th point in time after θp(0)is calculated, where i is an integer of 1 or more, and where wrepresents an estimate of the angular velocity of change in the angle tobe detected, and the correction processing is processing for correctingthe first and second signals.
 7. The correction method according toclaim 6, wherein the angle to be detected is an angle that a directionof a rotating magnetic field in a reference position forms with respectto a reference direction.
 8. The correction method according to claim 6,wherein the first ideal component and the second ideal component aredifferent in phase from each other by 90°.
 9. The correction methodaccording to claim 6, wherein, in the first step, prior to performingthe processing of sequentially calculating the ideal angle estimate, theuncorrected detected angle value and the error estimate, the uncorrecteddetected angle value is calculated sequentially at specified timeintervals T, and an average of angular velocities of change in theuncorrected detected angle value is calculated to use the average as theestimate ω of the angular velocity of change in the angle to bedetected.
 10. The correction method according to claim 6, wherein thecorrection information includes first correction information and secondcorrection information, the first correction information containing oneor more coefficients among a plurality of coefficients provided toexpress the first error component as a Fourier series, the secondcorrection information containing one or more coefficients among aplurality of coefficients provided to express the second error componentas a Fourier series, in the second step, a Fourier transform is appliedto a waveform representing change in the error estimate with respect tochange in the ideal angle estimate, and the first and second correctioninformation is determined based on a result thereof, and in thecorrection processing, an estimate of the first error component and anestimate of the second error component are obtained using the first andsecond signals before the correction processing and the first and secondcorrection information, the estimate of the first error component issubtracted from the first signal before the correction processing tothereby generate a corrected first signal, and the estimate of thesecond error component is subtracted from the second signal before thecorrection processing to thereby generate a corrected second signal. 11.An angle sensor comprising: a signal generator for generating a firstsignal and a second signal each having a correspondence with an angle tobe detected; an angle detector for generating a detected angle value byperforming computations using the first signal and the second signal,the detected angle value having a correspondence with the angle to bedetected; and a correction apparatus, wherein when the angle to bedetected varies with a predetermined period, the first signal contains afirst ideal component and a first error component, and the second signalcontains a second ideal component and a second error component, thefirst ideal component and the second ideal component are different inphase from each other and vary periodically in such a manner as to tracean ideal sinusoidal curve, the correction apparatus includes: acorrection information generator for generating correction information;and a correction processor for performing correction processing in acourse of generation of the detected angle value by the angle detector,details of the correction processing being determined based on thecorrection information, the correction processing is processing forbringing the detected angle value closer to an ideal angle estimate ascompared with an uncorrected detected angle value, the ideal angleestimate corresponding to the detected angle value obtained when thefirst signal does not contain the first error component, the secondsignal does not contain the second error component and the correctionprocessing is not performed, the uncorrected detected angle valuecorresponding to the detected angle value obtained when the correctionprocessing is not performed, the correction information generator is aprocessor for performing: first processing of generating an errorestimate based on the first signal and the second signal under acondition that the first signal varies over time to contain the firstideal component and the first error component and the second signalvaries over time to contain the second ideal component and the seconderror component, the error estimate having a correspondence with adifference between the uncorrected detected angle value and the idealangle estimate and containing a variable component that varies dependingon the ideal angle estimate; and second processing of determining thecorrection information based on the error estimate, the first processingincludes processing of sequentially calculating the ideal angleestimate, the uncorrected detected angle value and the error estimate atspecified time intervals T on an assumption that an angular velocity ofchange in the angle to be detected has a constant value, wherein theuncorrected detected angle value is calculated based on the first andsecond signals, and the error estimate is the difference between theuncorrected detected angle value and the ideal angle estimate, and theprocessing of sequentially calculating the ideal angle estimate, theuncorrected detected angle value and the error estimate assumes thatθp(0) represents a value of the uncorrected detected angle value at apoint in time when the uncorrected detected angle value is calculatedfor the first time after the processing of sequentially calculating isstarted, and that θc(0) represents a value of the ideal angle estimateat the point in time when θp(0) is calculated, and then calculates θc(i)and E(i) as θc(i)=θc(i−1)+ω·T and E(i)=θp(i)−θc(i), respectively, whereθc(i), θp(i), and E(i) respectively represent the ideal angle estimate,the uncorrected detected angle value, and the error estimate that arecalculated at an i-th point in time after θp(0) is calculated, where iis an integer of 1 or more, and where w represents an estimate of theangular velocity of change in the angle to be detected.
 12. The anglesensor according to claim 11, wherein the angle to be detected is anangle that a direction of a rotating magnetic field in a referenceposition forms with respect to a reference direction, the signalgenerator includes a first detection circuit for generating the firstsignal and a second detection circuit for generating the second signal,and each of the first and second detection circuits includes at leastone magnetic detection element for detecting the rotating magneticfield.
 13. The angle sensor according to claim 12, wherein the at leastone magnetic detection element is at least one magnetoresistance elementincluding a magnetization pinned layer whose magnetization direction ispinned, a free layer whose magnetization direction varies depending onthe direction of the rotating magnetic field, and a nonmagnetic layerlocated between the magnetization pinned layer and the free layer. 14.The angle sensor according to claim 11, wherein the first idealcomponent and the second ideal component are different in phase fromeach other by 90°.
 15. The angle sensor according to claim 11, whereinin the first processing, prior to the processing of sequentiallycalculating the ideal angle estimate, the uncorrected detected anglevalue and the error estimate, the uncorrected detected angle value iscalculated sequentially at specified time intervals T, and an average ofangular velocities of change in the uncorrected detected angle value iscalculated to use the average as the estimate ω of the angular velocityof change in the angle to be detected.
 16. The angle sensor according toclaim 11, wherein the correction processing is processing for correctingthe first and second signals.
 17. The angle sensor according to claim16, wherein the correction information includes first correctioninformation and second correction information, the first correctioninformation containing one or more coefficients among a plurality ofcoefficients provided to express the first error component as a Fourierseries, the second correction information containing one or morecoefficients among a plurality of coefficients provided to express thesecond error component as a Fourier series, the second processingapplies a Fourier transform to a waveform representing change in theerror estimate with respect to change in the ideal angle estimate, anddetermines the first and second correction information based on a resultthereof, and in the correction processing, an estimate of the firsterror component and an estimate of the second error component areobtained using the first and second signals before the correctionprocessing and the first and second correction information, the estimateof the first error component is subtracted from the first signal beforethe correction processing to thereby generate a corrected first signal,and the estimate of the second error component is subtracted from thesecond signal before the correction processing to thereby generate acorrected second signal.
 18. The angle sensor according to claim 11,wherein the correction processing is processing for generating thedetected angle value by calculating the uncorrected detected angle valuebased on the first and second signals and then correcting theuncorrected detected angle value.
 19. The angle sensor according toclaim 18, wherein the correction information is information that definesa waveform representing change in the variable component of the errorestimate with respect to change in the ideal angle estimate, and thesecond processing applies a Fourier transform to a waveform representingchange in the error estimate with respect to change in the ideal angleestimate, and determines the correction information based on a resultthereof.
 20. A correction apparatus comprising: an angle sensorincluding: a signal generator for generating a first signal and a secondsignal each having a correspondence with an angle to be detected; and anangle detector for generating a detected angle value by performingcomputations using the first signal and the second signal, the detectedangle value having a correspondence with the angle to be detected,wherein when the angle to be detected varies with a predeterminedperiod, the first signal contains a first ideal component and a firsterror component, and the second signal contains a second ideal componentand a second error component, and the first ideal component and thesecond ideal component are different in phase from each other and varyperiodically in such a manner as to trace an ideal sinusoidal curve; acorrection information generator for generating correction information;and a correction processor for performing correction processing in acourse of generation of the detected angle value by the angle detector,details of the correction processing being determined based on thecorrection information, wherein the correction processing is processingfor bringing the detected angle value closer to an ideal angle estimateas compared with an uncorrected detected angle value, the ideal angleestimate corresponding to the detected angle value obtained when thefirst signal does not contain the first error component, the secondsignal does not contain the second error component and the correctionprocessing is not performed, the uncorrected detected angle valuecorresponding to the detected angle value obtained when the correctionprocessing is not performed, the correction information generator is aprocessor for performing: first processing of generating an errorestimate based on the first signal and the second signal under acondition that the first signal varies over time to contain the firstideal component and the first error component and the second signalvaries over time to contain the second ideal component and the seconderror component, the error estimate having a correspondence with adifference between the uncorrected detected angle value and the idealangle estimate and containing a variable component that varies dependingon the ideal angle estimate; and second processing of determining thecorrection information based on the error estimate, the first processingincludes processing of sequentially calculating the ideal angleestimate, the uncorrected detected angle value and the error estimate atspecified time intervals T on an assumption that an angular velocity ofchange in the angle to be detected has a constant value, wherein theuncorrected detected angle value is calculated based on the first andsecond signals, and the error estimate is the difference between theuncorrected detected angle value and the ideal angle estimate, theprocessing of sequentially calculating the ideal angle estimate, theuncorrected detected angle value and the error estimate assumes thatθp(0) represents a value of the uncorrected detected angle value at apoint in time when the uncorrected detected angle value is calculatedfor the first time after the processing of sequentially calculating isstarted, and that θc(0) represents a value of the ideal angle estimateat the point in time when θp(0) is calculated, and then calculates θc(i)and E(i) as θc(i)=θc(i−1)+ω·T and E(i)=θp(i)−θc(i), respectively, whereθc(i), θp(i), and E(i) respectively represent the ideal angle estimate,the uncorrected detected angle value, and the error estimate that arecalculated at an i-th point in time after θp(0) is calculated, where iis an integer of 1 or more, and where w represents an estimate of theangular velocity of change in the angle to be detected, and thecorrection processing is processing for generating the detected anglevalue by calculating the uncorrected detected angle value based on thefirst and second signals and then correcting the uncorrected detectedangle value.
 21. The correction apparatus according to claim 20, whereinthe angle to be detected is an angle that a direction of a rotatingmagnetic field in a reference position forms with respect to a referencedirection.
 22. The correction apparatus according to claim 20, whereinthe first ideal component and the second ideal component are differentin phase from each other by 90°.
 23. The correction apparatus accordingto claim 20, wherein in the first processing, prior to the processing ofsequentially calculating the ideal angle estimate, the uncorrecteddetected angle value and the error estimate, the uncorrected detectedangle value is calculated sequentially at specified time intervals T,and an average of angular velocities of change in the uncorrecteddetected angle value is calculated to use the average as the estimate ωof the angular velocity of change in the angle to be detected.
 24. Thecorrection apparatus according to claim 20, wherein the correctioninformation is information that defines a waveform representing changein the variable component of the error estimate with respect to changein the ideal angle estimate, and the second processing applies a Fouriertransform to a waveform representing change in the error estimate withrespect to change in the ideal angle estimate, and determines thecorrection information based on a result thereof.
 25. A correctionmethod comprising: a step of providing an angle sensor including: asignal generator for generating a first signal and a second signal eachhaving a correspondence with an angle to be detected; and an angledetector for generating a detected angle value by performingcomputations using the first signal and the second signal, the detectedangle value having a correspondence with the angle to be detected, whenthe angle to be detected varies with a predetermined period, the firstsignal contains a first ideal component and a first error component, andthe second signal contains a second ideal component and a second errorcomponent, and the first ideal component and the second ideal componentare different in phase from each other and vary periodically in such amanner as to trace an ideal sinusoidal curve; a step of generatingcorrection information; and a step of performing correction processingin a course of generation of the detected angle value by the angledetector, details of the correction processing being determined based onthe correction information, wherein the correction processing isprocessing for bringing the detected angle value closer to an idealangle estimate as compared with an uncorrected detected angle value, theideal angle estimate corresponding to the detected angle value obtainedwhen the first signal does not contain the first error component, thesecond signal does not contain the second error component and thecorrection processing is not performed, the uncorrected detected anglevalue corresponding to the detected angle value obtained when thecorrection processing is not performed, the step of generating thecorrection information includes: a first step of generating an errorestimate based on the first signal and the second signal under acondition that the first signal varies over time to contain the firstideal component and the first error component and the second signalvaries over time to contain the second ideal component and the seconderror component, the error estimate having a correspondence with adifference between the uncorrected detected angle value and the idealangle estimate and containing a variable component that varies dependingon the ideal angle estimate; and a second step of determining thecorrection information based on the error estimate, the first stepincludes performing processing of sequentially calculating the idealangle estimate, the uncorrected detected angle value and the errorestimate at specified time intervals T on an assumption that an angularvelocity of change in the angle to be detected has a constant value,wherein the uncorrected detected angle value is calculated based on thefirst and second signals, and the error estimate is the differencebetween the uncorrected detected angle value and the ideal angleestimate, the processing of sequentially calculating the ideal angleestimate, the uncorrected detected angle value and the error estimateassumes that θp(0) represents a value of the uncorrected detected anglevalue at a point in time when the uncorrected detected angle value iscalculated for the first time after the processing of sequentiallycalculating is started, and that θc(0) represents a value of the idealangle estimate at the point in time when θp(0) is calculated, and thencalculates θc(i) and E(i) as θc(i)=θc(i−1)+ω·T and E(i)=θp(i)−θc(i),respectively, where θc(i), θp(i), and E(i) respectively represent theideal angle estimate, the uncorrected detected angle value, and theerror estimate that are calculated at an i-th point in time after θp(0)is calculated, where i is an integer of 1 or more, and where wrepresents an estimate of the angular velocity of change in the angle tobe detected, and the correction processing is processing for generatingthe detected angle value by calculating the uncorrected detected anglevalue based on the first and second signals and then correcting theuncorrected detected angle value.
 26. The correction method according toclaim 25, wherein the angle to be detected is an angle that a directionof a rotating magnetic field in a reference position forms with respectto a reference direction.
 27. The correction method according to claim25, wherein the first ideal component and the second ideal component aredifferent in phase from each other by 90°.
 28. The correction methodaccording to claim 25, wherein, in the first step, prior to performingthe processing of sequentially calculating the ideal angle estimate, theuncorrected detected angle value and the error estimate, the uncorrecteddetected angle value is calculated sequentially at specified timeintervals T, and an average of angular velocities of change in theuncorrected detected angle value is calculated to use the average as theestimate ω of the angular velocity of change in the angle to bedetected.
 29. The correction method according to claim 25, wherein thecorrection information is information that defines a waveformrepresenting change in the variable component of the error estimate withrespect to change in the ideal angle estimate, and in the second step, aFourier transform is applied to a waveform representing change in theerror estimate with respect to change in the ideal angle estimate, andthe correction information is determined based on a result thereof.